package com.infore.qualityControl.util;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ResultEntityUtil {
	
	/**
	 * 通过ResultEntity 获取单个Map形式的实体 注：取一个
	 * @param resultEntity
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public static Map<String, Object> getDataListMap (ResultEntity resultEntity) {
		 HashMap<String, Object>  resultMap =  (HashMap<String, Object>) resultEntity.getContent();
		 List<Map<String, Object>> dataList = (List<Map<String, Object>>) resultMap.get("dataList");
		return  dataList.get(0);
	}

	@SuppressWarnings("unchecked")
	public static Map<String, Object> getValueMap (ResultEntity resultEntity) {
		HashMap<String, Object>  resultMap =  (HashMap<String, Object>) resultEntity.getContent();
		List<Map<String, Object>> dataList = (List<Map<String, Object>>) resultMap.get("value");
		return  dataList.get(0);
	}
}
